package com.umeox.watch.moto.gallery.base

import android.content.Context
import androidx.multidex.MultiDexApplication
import com.umeox.watch.moto.dataservice.DataProvider
import com.umeox.watch.moto.gallery.R
import uk.co.chrisjenx.calligraphy.CalligraphyConfig

/**
 * Created by Rambo 2021/9/7
 * Describe:
 */
class BaseApp : MultiDexApplication() {


    companion object{
        private var appContext: Context? = null
        fun getContext(): Context {
            return appContext as Context
        }
    }

    override fun onCreate() {
        super.onCreate()
        appContext = this
        DataProvider.initialize(this)

        CalligraphyConfig.initDefault(
            CalligraphyConfig.Builder()
                .setDefaultFontPath("fonts/Roboto-Medium.ttf")
                .setFontAttrId(R.attr.fontPath)
                .build()
        )
    }
}